<head>
    <meta name='layout' content='register'/>
    %{--<meta name='layout' content='main'/>--}%
    <title><g:message code='spring.security.ui.register.title'/></title>
</head>

<body>

<p/>

<s2ui:form width='650' height='300' elementId='loginFormContainer'
           titleCode='spring.security.ui.register.description' center='true' resizeable='false'>

    <g:form action='register' name='registerForm'>

        <g:if test='${emailSent}'>
            <br/>
            <g:message code='spring.security.ui.register.sent'/>
        </g:if>
        <g:else>

            <br/>

            <table>
                <tbody>
                <s2ui:textFieldRow name='username' labelCode='user.username.label' bean="${command}"
                                   size='40' labelCodeDefault='Username' value="${command.username}"/>

                <s2ui:textFieldRow name='email' bean="${command}" value="${command.email}"
                                   size='40' labelCode='user.email.label' labelCodeDefault='E-mail'/>

                <s2ui:passwordFieldRow name='password' labelCode='user.password.label' bean="${command}"
                                       size='40' labelCodeDefault='Password' value="${command.password}"/>

                <s2ui:passwordFieldRow name='password2' labelCode='user.password2.label' bean="${command}"
                                       size='40' labelCodeDefault='Password (again)' value="${command.password2}"/>

                </tbody>
            </table>

            <a id="create">Create your account</a>
            <input type='submit' value=' ' id='create_submit' class='s2ui_hidden_button'/>
        </g:else>

    </g:form>

</s2ui:form>





<r:script>
    $(document).ready(function() {
        $('#username').focus();
    });
    $(document).ready(function() {
        $("#create").button();
        $('#create').bind('click', function() {
            document.forms.registerForm.submit();
        });
    });
    $(document).ready(function() {
			$('#loginFormContainer').resizable();
		});
</r:script>

</body>
